package com.flexcodejam.vfd.business
{
	
	import mx.rpc.IResponder;
	import com.adobe.cairngorm.business.ServiceLocator;
	import mx.rpc.events.FaultEvent;
	import mx.rpc.events.ResultEvent;
	import com.flexcodejam.vfd.vo.FoodDrive;
	import com.flexcodejam.vfd.vo.Organization;
	

	
	public class OrganizationDelegate
	{
		
		private var responder : IResponder;
		private var service : Object;
		
		public function OrganizationDelegate( responder : IResponder )
		{		
			this.service = ServiceLocator.getInstance().getRemoteObject("OrganizationService" );
			this.responder = responder;
		}
		
		public function SaveOrganization(organization:Organization): void
		{
			
			//Save Comment Object
			var call : Object = service.SaveOrganization(organization);
			call.addResponder( responder );
		}	
		
		public function getOrganizationById(organization:Organization):void{
			//Agregar Address Object
			var call : Object = service.GetOrganizationByID(organization.ID);
			call.addResponder( responder );
		}
		
		public function getAllOrganizations():void{
			//Agregar Address Object
			var call : Object = service.GetAllOrganizations();
			call.addResponder( responder );
		}
		
	}
}